package com.happy016.feign;


import com.happy016.pojo.User;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


//service-user服务名称,对应项目SpringCloud-Service-User,fallback容错回退执行类
@FeignClient(name = "SERVICE-USER",fallback = UserFeignFallBack.class)
// 如果没有使用eureka 则这么写:
// @FeignClient(name = "SERVICE-USER",url="SERVICE-USER服务地址")
//自定义配置写法
//@FeignClient(name = "SERVICE-USER",configuration= FeignConfiguration.class)
public interface UserFeignClient {


    /**
     * 这个路径对应 service-user里面的路径
     * @author Linyb
     * @since 2017/9/30 16:19
     */
    @RequestMapping(value = "/user/get/{id}",method = RequestMethod.GET)
    User findById(@PathVariable("id") Integer id);

}
